<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{LANG_GLOBAL:Version}</title>
<link href="html/css/css.css" rel="stylesheet" type="text/css" />
<script Language="JavaScript" src="html/js/functions.js"></script>
<script language="javascript" src="html/js/rlselectdate.js"></script>

<script type="text/javascript">
// <![CDATA[
var listItem;
window.onload = function() {
	listItem = new list_item_onclick('list_item');
	listItem.init();
};

var oCalendarEn=new PopupCalendar("oCalendarEn");    //初始化控件时,请给出实例名称如:oCalendarEn
oCalendarEn.Init();

var oCalendarChs=new PopupCalendar("oCalendarChs");    //初始化控件时,请给出实例名称:oCalendarChs
oCalendarChs.weekDaySting=new Array("星期一","星期二","星期三","星期四","星期五","星期六","星期天");
oCalendarChs.monthSting=new Array("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");
oCalendarChs.oBtnTodayTitle="今天";
oCalendarChs.oBtnCancelTitle="关闭";
oCalendarChs.Init();

function selectSingle(obj)
{
	var id = listItem.get_input_value();
	
	if(id == 0)
	{
		msg_box('请至少选择一个');
		return false;
	}

	var id_arr = id.split(",");
	var id_num = id_arr.length
	
	if(id_num > 1)
	{
		msg_box('只能选择一个');
		return false;
	}
	
	obj.href += '&Id=' + id;
	
	return true;
}

function delMany(obj,url)
{
	var id = listItem.get_input_value();
	
	if(id == 0)
	{
		msg_box('请至少选择一条记录');
		return false;
	}
	
	var url = obj.href + '&Id=' + id;

	msg_box('您确定要删除这几条纪录吗？' , url);
	
	return false;
}

function open()
{
	get_obj('cate_list').href = "javascript:close(this);";
	get_obj('cate_list').innerHTML = "关闭分类列表";
	window.parent.open();
}

function close()
{
	get_obj('cate_list').href = "javascript:open(this);";
	get_obj('cate_list').innerHTML = "展示分类列表";
	window.parent.close();
}

// ]]>
</script>
</head>

<if $Msg>
<div id="msg"><img src="html/images/information.gif" width="16" height="16" align="absmiddle" /> [$Msg]</div>
</if>

<body style="height:auto;overflow-x:hidden">

<div class="top_tool">
<div>
<a href="index.php?c=ad&d=add"><img src="html/images/ad_add.gif" border="0" align="absmiddle" /> 添加</a>
<a href="index.php?c=ad&d=edit"  onclick="return selectSingle(this);"><img src="html/images/pencil.gif" border="0" align="absmiddle" /> 编辑</a>
<a href="index.php?c=ad&d=del" onclick="return delMany(this);"><img src="html/images/bin_closed.gif" border="0" align="absmiddle" /> 删除</a>
<a href="javascript:search_box(this);"><img src="html/images/search.gif" border="0" align="absmiddle" /> 搜索 </a>
</div>
</div>

<div class="search_box" id="search_box" style="display:none">
<form action="" method="post" enctype="multipart/form-data" style="margin:0px;">
	<div style="clear:both"></div>
	<div class="item">
    广告标题: <input name="Keywords" type="text" value="" />
    </div>
    <div class="item">
    开始时间 : <input name="StartDate" value="" type="text" onclick="getDateString(this,oCalendarChs)" readonly style="width:25%" />&nbsp;&nbsp;&nbsp;&nbsp;结束时间 : <input name="EndDate" type="text" onclick="getDateString(this,oCalendarChs)" readonly style="width:25%" value="" /> 
    </div>
    <div class="item">
    <input name="" type="image" src="html/images/search_bottom.gif" style="width:auto;" align="absmiddle" />&nbsp;&nbsp;&nbsp;(再次按搜索可以关闭搜索框)
    </div>
    <div style="clear:both"></div>
</form>
</div>

<div class="list_intro"> 
	<div class="left">[ <b>广告列表</b>]</div>
    <div style="clear:both"></div>
</div>

<div class="list_menu">
<span class="checkbox"><input name="ID[]" type="checkbox" value="" onclick="listItem.click_all(this);" /></span>
<span class="type">序号</span>
<span class="tilte">标题</span>
<span class="type">标识符</span>
<span class="type">发布时间</span>
<span class="type">结束时间</span>
<span class="type">状态</span>
</div>
<div class="list_item" id="list_item">

<if $List>
<foreach name="List" key="key" var="var">
   <div>
    <span class="checkbox"><input name="Id[]" type="checkbox" value="[$var.Id]" /></span>
    <span class="type">[$var.Id]</span>
    <span class="tilte">
    
    <if time() > $var.EndDate>
    [$var.Name]<font color="#ff0000">[已经过期]</font>
    <else>
    [$var.Name]
   	</if>
    
    </span>
    <span class="type">[$var.Mark]</span>
    <span class="type">[@date('Y-m-d',$var.StartDate)]</span>
    <span class="type">[@date('Y-m-d',$var.EndDate)]</span>
    <span class="type">
    <if $var.State == 1>
    正常
    <else>
    <font color="#ff0000">禁用</font>
    </if>
    </span>
    <div style="clear:both; border:none"></div>
    </div>
</foreach>

<else>

    <div>
    <span class="time">目前还没有广告位置！</span>
    <div style="clear:both; border:none"></div>
    </div>

</if>

<div class="page">
    记录数:[$ListNum]&nbsp;&nbsp;页次:[$CurrentPage]/[$PageNum]&nbsp;&nbsp;分页:[$PageList]&nbsp;</div>
</div>
</body>
</html>
